<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UserList.ascx.cs" Inherits="admin_UserList" %>
<script type="text/javascript">
    var the_url = "";
    function get_text() {
        the_url ="Default.aspx?ctrl=user_list&search="+ document.getElementById("txtSearch").value;
    }
</script>
<table>
    <tr>
        <td style="width: 139px">
            <asp:Label ID="Label1" runat="server" Text="Enter text to search:"></asp:Label></td>
        <td style="width: 100px">
            <input id="txtSearch" type="text" /></td>
        <td style="width: 100px">
            <a class="c_button" href="javascript:location=the_url" onclick="get_text();">Search</a>
        </td>
    </tr>
</table>
<br />
List of accounts:<br />
<asp:GridView ID="dgrAccount" CssClass="list_table" runat="server" AutoGenerateColumns="False" OnRowDeleting="dgrAccount_RowDeleting" DataKeyNames="Id">
    <Columns>
        <asp:BoundField DataField="Username" HeaderText="Username" />
        <asp:TemplateField HeaderText="Role">
            <ItemTemplate>
            <%#GetRoleName(Eval("Role"))%>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Registered date">          
            <ItemTemplate>
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("RegisteredDate","{0:MMM, dd yyyy}") %>'></asp:Label>
            </ItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Owner">       
            <ItemTemplate>
                <%#Eval("PersonInfor.FirstName")%> <%#Eval("PersonInfor.LastName")%>
            </ItemTemplate>
        </asp:TemplateField>        
        <asp:CommandField ShowDeleteButton="True" />
    </Columns>
</asp:GridView>
<br />
<asp:Label ID="lblPaging" runat="server"></asp:Label>
